from __future__ import unicode_literals

from django.db import models


# Create your models here.

class Article(models.Model):
    title = models.CharField(max_length=50)
    link = models.CharField(max_length=50)
    pubDate = models.CharField(max_length=30)
    description = models.TextField()
    create_date = models.DateField(auto_now=True)
    name=models.CharField(max_length=25)
    
    def __unicode__(self):
        return self.title
        
    def __hash__(self):
        return hash(self.link)
        
    def __eq__(self, other):
        if isinstance(other,Article):
            return self.link==other.link
        else:
            return False

class FeedSource(models.Model):
    name = models.CharField(max_length=30)
    link = models.CharField(max_length=50)

    def __unicode__(self):
        return self.name
